Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
is it possible to make the key "down" act like a "tab" for tabindexes

CONTEXT : Many <img tabindex="x" one under an other. When any user press tab: it "goes" to the next item, surround the item with blue border and the voice readers reads the alt text (or any tab behaviour...) [that's only an example].

WHAT I WANT : that when a user hit (on his keyboard) the key "down" => that it triggers the SAME behaviour as the tab = go to the next tabindex and read the alt text or what behaviour that a normal tab does.

NOTE : This question is NOT about the voice reading thing => it's ONLY to give an example of what a normal tabs does

WHAT I DON'T WANT : .focus() because it applies to inputs, here my tab index goes to the nest image.

WHAT I TRIED : without success (unless I misstype something)

$("html").keydown(function(e) {
    if (e.keyCode==40) {
      console.log("key down was pressed");
      document.dispatchEvent( new window.KeyboardEvent('keydown',  { key : 'Tab' }) );
    }
}

in this code the console.log gets triggered and I see "key down was pressed" but no tab was triggered.

Is there a way to do what I describe ?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda